<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mobile/iPhone/Site.Master"
    Inherits="System.Web.Mvc.ViewPage<Thor.Models.Credentials>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">


</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script language="JavaScript" type="text/javascript" src="/Scripts/jquery-1.3.2.min.js"></script>
    <script language="JavaScript" type="text/javascript" src="/Scripts/jsbn.js"></script>
    <script language="JavaScript" type="text/javascript" src="/Scripts/prng4.js"></script>
    <script language="JavaScript" type="text/javascript" src="/Scripts/rng.js"></script>
    <script language="JavaScript" type="text/javascript" src="/Scripts/RSA.js"></script>
    <script language="javascript" type="text/javascript">
        function encrypt() {
            var pwd = document.all["Password"].value;
            var name = document.all["UserName"].value;

            var mod = document.all["Modulus"].value;
            var exp = document.all["Exponent"].value;
            var rsa = new RSAKey();
            rsa.setPublic(mod, exp);
            document.all["Password"].style.visibility = 'hidden';
            document.all["Password"].value = rsa.encrypt(pwd);
            document.all["UserName"].style.visibility = 'hidden';
            document.all["UserName"].value = rsa.encrypt(name);
            document.forms[0].submit();
        }
    </script>
    <img alt="" src="..\..\..\..\Content\Logo.png" />
    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm("LogOn", "Account"))
       { %>
    <div>
    <%= Html.Hidden("Modulus")%>
    <%= Html.Hidden("Exponent")%>
    <%= Html.Hidden("Id")%>
    <%= Html.Hidden("ReferringUrl")%>
        <fieldset>
            <legend>Log On</legend>
            <p>
                <label for="UserName">
                    User Name:</label>
                <%= Html.TextBox("UserName")%>
                <%= Html.ValidationMessage("UserName", "*") %>
            </p>
            <p>
                <label for="Password">
                    Password:</label>
                <%= Html.Password("Password")%>
                <%= Html.ValidationMessage("Password", "*") %>
            </p>
            <p>
                <%= Html.CheckBox("Persist", true) %><label class="inline" for="Persist">Remember me?</label>
            </p>
            <p>
                <input type="submit" value="Log On"  style="visibility:hidden"/>
                <input type="button" value="Log In" onclick="encrypt()" />
            </p>
            
        </fieldset>
    </div>
    <% } %>
</asp:Content>
